# from threading import Thread
# import threading
# import time
#
#
# def task(name):
#     time.sleep(1)
#     print(f'{name} is running')
#     print(threading.current_thread().name)
#
#
#
# if __name__ == '__main__':
#     for i in range(5):
#         t = Thread(target=task,args=('mcsaoQ',))
#         t.start()
#     # 线程对象的方法:
#     # time.sleep(1)
#     # print(t.is_alive())  # 判断子线程是否存活  ***
#     # print(t.getName())  #　获取线程名
#     # t.setName('线程111')
#     # print(t.getName())  # 获取线程名
#
#     # threading模块的方法:
#     # print(threading.current_thread().name)  # MainThread
#     # print(threading.enumerate())  # 返回一个列表 放置的是所有的线程对象
#     print(threading.active_count())  # 获取活跃的线程的数量(包括主线程)
#     print('主线程')